<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="ajile/com.iskitz.ajile.js?mvcoff,mvcshareoff,refresh"></script>
<script type="text/javascript" src="org.wattdepot.gdata.makahiki.Timestamp.js"></script>
<script type="text/javascript" src="org.wattdepot.gdata.GDataLoader.js"></script>
<script type="text/javascript" src="org.wattdepot.gdata.makahiki.EnergyStatusSummary.js"></script>
<script type="text/javascript" src="org.wattdepot.gdata.kukuicup.Configuration.js"></script>

<script type="text/javascript">
// Wrap this code in an anonymous self-invoking function to avoid polluting global namespace.
(function() {
  // Get the kukui cup configuration file. 
  var configuration = new org.wattdepot.gdata.kukuicup.Configuration();
  // Specify the floor of interest.
  var source = configuration.ilima_3_4;
  // Get the spreadsheets we need.
  var energySummaryDataUrl = configuration.getEnergySummaryDataUrl();
  var baselineDataUrl = configuration.getBaselineDataUrl();
  var currentPowerDataUrl = configuration.getCurrentPowerDataUrl();
  // How frequently we want these spreadsheets to be refreshed.
  var energySummaryRefreshInterval = 600;  // every 10 minutes (for last hr sparkline).
  var baselineRefreshInterval = 0; // never refresh.
  var currentPowerRefreshInterval = 30; // once every 30 seconds.
  // Load the visualization API and the spreadsheet data, then call displayDormData.
  var loader = new org.wattdepot.gdata.GDataLoader(displayDormData, 
						   energySummaryDataUrl, energySummaryRefreshInterval,
						   baselineDataUrl, baselineRefreshInterval,
						   currentPowerDataUrl, currentPowerRefreshInterval);

  function displayDormData(energySummaryDatatable, baselineDatatable, currentPowerDatatable) {
    // Create and draw the StatusSummaryExample instance.    
    var summary = new org.wattdepot.gdata.makahiki.EnergyStatusSummary(configuration, source);
    summary.draw(energySummaryDatatable, baselineDatatable, currentPowerDatatable, 'summary_div');
  }
})();
</script>
</head>

<body>
  <div id="summary_div"></div>
</body>
</html>




